package cn.lh.controller;

import cn.lh.domain.Store;
import cn.lh.service.IStoreService;
import cn.lh.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/store")
public class StoreController {
    @Autowired
    private IStoreService storeService;
    @PutMapping
    public JsonResult add(@RequestBody Store store) {
        try {
            storeService.add(store);
            return JsonResult.set(true, "添加成功");
        } catch (Exception e) {
            e.printStackTrace();
            return JsonResult.set(false, "系统错误，稍后重试");
        }
    }
}
